<template>
    <div id="app">
        <router-view/>
    </div>
</template>
<script>
  import _subject from './assets/utils/subject'

  export default {
    data() {
      return {
        //全局websocket监听
        wsSub: null
      }
    },
    created() {
      this.wsSub = _subject.ws.subscribe({
        next(t) {
          console.log('global ws msg: ', t)
        }
      })
    },
    destroyed() {
      if (this.wsSub) {
        _subject.offline()
        this.wsSub.unsubscribe()
      }
    }
  }
</script>
<style lang="scss">
    #app {
        width: 100%;
        height: 100%;
    }
</style>

